//
//  ActivityCollectViewController.m
//  又是豆瓣
//
//  Created by dllo on 16/1/9.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ActivityCollectViewController.h"
#import "DBmethod.h"
#import "actModel.h"

@interface ActivityCollectViewController ()<UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, retain)  NSArray *arrModel;

@end

@implementation ActivityCollectViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UITableView *tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    
    tableView.delegate = self;
    tableView.dataSource = self;
    
    [tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    
    [self.view addSubview:tableView];
    [tableView release];
    
    self.navigationItem.title = @"活动收藏";
    
//    self.arrModel = [NSArray array];
    
    self.arrModel = [NSArray arrayWithArray:[[DBmethod sharedDataBaseMethod] selectDatafromtable:@"MyActivities"]];

    
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];

 actModel *model  = _arrModel[indexPath.row];
    cell.textLabel.text = model.title;
    
    return cell;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _arrModel.count;
}



- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
